package com.voice.server.repository;


import com.voice.server.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Collection;
import java.util.List;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-04-23 11:54:50
 */
public interface UserRepository extends JpaRepository<User,String> {

    User findByPhone(String phone);

    List<User> findByIdIn(Collection<String> ids);

    @Query("select id from User where phone like %?1%")
    List<String> findIdListByPhoneLike(String phone);
}
